home *** CD-ROM | disk | FTP | other *** search
/ PC Media 7 / PC MEDIA CD07.iso / share / uwin / cassette / printvie.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-29  |  2.3 KB  |  88 lines

  1. // Copyright (c) 1994, William Wagner
  2. // All Rights reserved.
  3. //
  4. // This source is a portion of a shareware program.  It may be distributed
  5. // only in its entirety.  The copyright statements must be included with any 
  6. // reproduction of this source.
  7. // 
  8.  
  9. // printvie.h : header file
  10. //
  11.  
  12. #ifndef __PRINTVIE_H__
  13. #define __PRINTVIE_H__
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CPrintView view
  17. //
  18. // This class is responsible for the display of the print display
  19. // of the document.
  20. //
  21.  
  22. class CPrintView : public CScrollView
  23. {
  24.     DECLARE_DYNCREATE(CPrintView)
  25. protected:
  26.     CPrintView();            // protected constructor used by dynamic creation
  27.  
  28. friend class CMainFrame; // The CMainFrame class can call the print routines.  
  29.  
  30. // Attributes
  31. public:
  32.     //Return a pointer to the document.  This is 
  33.     // non-const to avoid hiding the base class, and
  34.     // is instead a new function.
  35.     CCassetteDoc* GetDocument ();
  36.  
  37. private:
  38. //All of the data is a set of rectangles for text drawing and hit tests.
  39.     // Text drawing rectangles
  40.     const CRect m_Side1Rect;
  41.     const CRect m_Side2Rect; 
  42.     const CRect m_ArtistTextRect; 
  43.     const CRect m_AlbumTextRect; 
  44.     const CRect m_NotesTextRect;
  45.         
  46.     // Hit Test rectangles for the double clicks
  47.     const CRect m_SongsRect;
  48.     const CRect m_ArtistRect;
  49.     const CRect m_AlbumRect;
  50.     const CRect m_NotesRect;
  51.     
  52. // Operations
  53. public:
  54.     
  55. // Implementation
  56. private:
  57.     void DrawLines (CDC* pDC) const;
  58.     void DrawTextData (CDC* pDC, const CCassetteDoc* pDoc) const;
  59.     
  60.  
  61. protected:
  62.     //Destroy this.
  63.     virtual ~CPrintView();
  64.     // overridden to draw this view
  65.     virtual    void OnDraw(CDC* pDC);
  66.     //Receive updates.
  67.     virtual void OnUpdate (CView* pSender, LPARAM lHint, CObject* pHint);
  68.     //First update:
  69.     virtual    void OnInitialUpdate();
  70.     //Prepare for printing.
  71.     virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  72.  
  73.     // Generated message map functions
  74.     //The Double click is used to change the fonts for this tape.    
  75.     //{{AFX_MSG(CPrintView)
  76.     afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  77.     //}}AFX_MSG
  78.     DECLARE_MESSAGE_MAP()
  79. };
  80.  
  81. #ifndef _DEBUG // debug version in printvie.cpp
  82. inline CCassetteDoc* CPrintView::GetDocument()
  83.    { return (CCassetteDoc*) m_pDocument; }
  84. #endif
  85.  
  86. /////////////////////////////////////////////////////////////////////////////
  87. #endif
  88.